/*
* 全局进度条控制
*/

// 状态
const state = {
    loading: false
}

// 同步
// 调用方式:store.commit()
const mutations = {
    // 修改进度条状态
    setloadding(state: any, load: any) {
        state.loading = load
    }
}

// 异步
// 调用方式store.dispatch()
const actions = {
    // 修改进度条状态
    setloadding(context: any, load: any){
        context.commit("setloadding",load);
    }
}

const getters = {
    // 获取当前进度条状态
    isloading:(state: any)=>{
        return state.loading
    }
}

export default {
    namespaced:true,
    state: state,
    mutations: mutations,
    actions: actions,
    getters: getters
}

